home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr13 / gc0165.zip / RTFTYPE.H < prev   
Text File  |  1993-11-19  |  3KB  |  93 lines

  1.  
  2. typedef char bool;
  3. #define fTrue 1
  4. #define fFalse 0
  5.  
  6. typedef struct char_prop
  7. {
  8.     char fBold;
  9.     char fUnderline;
  10.     char fItalic;
  11. } CHP;                  // CHaracter Properties
  12.  
  13. typedef enum {justL, justR, justC, justF } JUST;
  14. typedef struct para_prop
  15. {
  16.     int xaLeft;                 // left indent in twips
  17.     int xaRight;                // right indent in twips
  18.     int xaFirst;                // first line indent in twips
  19.     JUST just;                  // justification
  20. } PAP;                  // PAragraph Properties
  21.  
  22. typedef enum {sbkNon, sbkCol, sbkEvn, sbkOdd, sbkPg} SBK;
  23. typedef enum {pgDec, pgURom, pgLRom, pgULtr, pgLLtr} PGN;
  24. typedef struct sect_prop
  25. {
  26.     int cCols;                  // number of columns
  27.     SBK sbk;                    // section break type
  28.     int xaPgn;                  // x position of page number in twips
  29.     int yaPgn;                  // y position of page number in twips
  30.     PGN pgnFormat;              // how the page number is formatted
  31. } SEP;                  // SEction Properties
  32.  
  33. typedef struct doc_prop
  34. {
  35.     int xaPage;                 // page width in twips
  36.     int yaPage;                 // page height in twips
  37.     int xaLeft;                 // left margin in twips
  38.     int yaTop;                  // top margin in twips
  39.     int xaRight;                // right margin in twips
  40.     int yaBottom;               // bottom margin in twips
  41.     int pgnStart;               // starting page number in twips
  42.     char fFacingp;              // facing pages enabled?
  43.     char fLandscape;            // landscape or portrait??
  44. } DOP;                  // DOcument Properties
  45.  
  46. typedef enum { rdsNorm, rdsSkip } RDS;              // Rtf Destination State
  47. typedef enum { risNorm, risBin, risHex } RIS;       // Rtf Internal State
  48.  
  49. typedef struct save             // property save structure
  50. {
  51.     struct save *pNext;         // next save
  52.     CHP chp;
  53.     PAP pap;
  54.     SEP sep;
  55.     DOP dop;
  56.     RDS rds;
  57.     RIS ris;
  58. } SAVE;
  59.  
  60. // What types of properties are there?
  61. typedef enum {ipropBold, ipropItalic, ipropUnderline, ipropLeftInd,
  62.               ipropRightInd, ipropFirstInd, ipropCols, ipropPgnX,
  63.               ipropPgnY, ipropXaPage, ipropYaPage, ipropXaLeft,
  64.               ipropXaRight, ipropYaTop, ipropYaBottom, ipropPgnStart,
  65.               ipropSbk, ipropPgnFormat, ipropFacingp, ipropLandscape,
  66.               ipropJust, ipropPard, ipropPlain, ipropSectd,
  67.               ipropMax } IPROP;
  68.  
  69. typedef enum {actnSpec, actnByte, actnWord} ACTN;
  70. typedef enum {propChp, propPap, propSep, propDop} PROPTYPE;
  71.  
  72. typedef struct propmod
  73. {
  74.     ACTN actn;              // size of value
  75.     PROPTYPE prop;          // structure containing value
  76.     int  offset;            // offset of value from base of structure
  77. } PROP;
  78.  
  79. typedef enum {ipfnBin, ipfnHex, ipfnSkipDest } IPFN;
  80. typedef enum {idestPict, idestSkip } IDEST;
  81. typedef enum {kwdChar, kwdDest, kwdProp, kwdSpec} KWD;
  82.  
  83. typedef struct symbol
  84. {
  85.     char *szKeyword;        // RTF keyword
  86.     int  dflt;              // default value to use
  87.     bool fPassDflt;         // true to use default value from this table
  88.     KWD  kwd;               // base action to take
  89.     int  idx;               // index into property table if kwd == kwdProp
  90.                             // index into destination table if kwd == kwdDest
  91.                             // character to print if kwd == kwdChar
  92. } SYM;
  93.